<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Info extends Model
{
    use SoftDeletes;
    protected $table = 'infos';

    //指定主键
    protected $primaryKey = 'id';

    //指定允许批量赋值的字段
    protected $fillable = [
        'name',
        'status',
        'is_hot',
        'is_push',
        'is_new',
        'tag',
        'xindex',
        'describe',
        'simpledescribe',
        'author',
        'author_role',
        'theme',
        'page_view',
        'jump_url',
        'price',
        'original_price',
        'set_time_out',
        'sale',
        'file',
        'extend_1',
        'extend_2',
        'extend_3',
        'extend_4',
        'extend_5',
        'extend_6',
        'extend_7',
        'extend_8',
        'extend_9',
    ];

    //指定不允许批量赋值的字段
    protected $guarded = [];

    //自动维护时间戳
    public $timestamps = true;

    //定制时间戳格式
//    protected $dateFormat = 'U';

    //添加软删除
    protected $dates = ['deleted_at'];
}
